package com.yhs;
import java.util.*;
/**
 *
 *
 */
public class Day1 {
    public static void main(String[] args) {
//99乘法表
        System.out.println("//99乘法表");
        int row = 9;//行的最大值
        int col = 9;//列的最大值

        for (int i = 1; i <= row; i++) {
            //打印九行之后，打印列
            for (int j = 1; j <= i; j++) {
                System.out.print(i + "*" + j + "=" + i * j + "\t");
            }
            System.out.println(); //每输入完一行所有内容再进行换行
        }

//直角三角形
        System.out.println("//直角三角形");
        System.out.println("想打印的行数：");
        int row2 = new Scanner(System.in).nextInt();//键入
        for (int i = 1; i <= row2; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
//等腰三角形
        System.out.println("//等腰三角形");
        System.out.println("想打印的行数：");
        int row3 = new Scanner(System.in).nextInt();//键入
        for (int i = 1; i <= row3; i++) {
            for (int t = 1; t <= row3 - i; t++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= 2 * i - 1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
//空心等腰三角形
System.out.println("//空心等腰三角形");
        System.out.println("想打印的行数：");
        int row4 = new Scanner(System.in).nextInt();
        //键入
        for (int i = 1; i <= row4; i++) {
            for (int t = 1; t <= row4 - i; t++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= 2 * i - 1; j++) {
                //只在首尾部打印
                if (j == 1 || j == 2 * i - 1) {
                    System.out.print("*");
                } else
                    {
                        System.out.print(" ");
                    }
            }
            System.out.println();
        }
        //菱形
        System.out.println("//菱形");
        System.out.println("想打印的行数：");
        int row5 = new Scanner(System.in).nextInt();
        //键入
        for (int i = 1; i <= row5; i++) {
            for (int t = 1; t <= row5 - i; t++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= 2 * i - 1; j++) {
                //只在首尾部打印
                if (j == 1 || j == 2 * i - 1) {
                    System.out.print("*");
                } else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
        //下半部分
        for (int i = row5 - 1; i >= 1; i --) {
            for (int t = 1; t <= row5 - i; t++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= 2 * i - 1; j++) {
                //只在首尾部打印
                if (j == 1 || j == 2 * i - 1) {
                    System.out.print("*");
                } else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}

